from django.urls import path, include
from rest_framework.routers import DefaultRouter
from api import views

router = DefaultRouter()
router.register(r'shopinfos', views.ShopInfoViewSet)

urlpatterns = [
    path('login', views.LoginAPIView.as_view()),  # 登录
    path('jwt', views.DrfJwtOrderAVPIView.as_view()),  # 测试jwt
    path('te', views.TestAPI.as_view()),                # 用户进行登录测试
    path('getuser', views.getUserInfoAPIView.as_view()),  # 获取用户信息
    path('upavator', views.UploadAPIView.as_view()),  # 用户上传信息
    path('publishpost', views.publishPostAPIView.as_view()),  # 用户发布帖子
    path('publishpostimg', views.publishPostImageAPIView.as_view()),  # 用户上传帖子图片
    path('getpost/', views.getPost2APIView.as_view(), name='post_list'),  # 请求帖子
    path('getpostdetail/<int:pk>/', views.PostDetailAPIView.as_view(), name='post_detail'),  # 获取帖子详情
    path('likestatus/<int:pk>/', views.likeStatusAPIView.as_view()),  # 判断用户是否点赞
    path('addcomment/<int:pk>/', views.addCommentAPIView.as_view()),  # 用户添加评论
    path('getbanners', views.bannerAPIView.as_view()),  # 获取轮播图
    path('getshop', views.ShopListAPIView.as_view()),  # 获取二手商品信息
    path('getshopdetail/<int:pk>/', views.getShopDetailAPIView.as_view()),  # 获取单个二手商品信息
    path('creaorder', views.createOrderAPIView.as_view()),  # 创建订单
    path('getorder/<int:pk>/', views.OrderDetailAPIView.as_view()),  # 获取订单的详细信息
    path('orderfinish/<int:pk>/', views.OrderFinishAPIView.as_view()),  # 点击完成订单
    path('myhome', views.myHomeAPIView.as_view()),  # 用户主页获取帖子
    path('delpost/<int:pk>/', views.deletePostAPIView.as_view()),  # 删除帖子
    path('otherhome/<str:pk>/', views.otherHomeAPIView.as_view()),  # 访问他人主页
    path('getlike', views.UserPostActivityView.as_view()),  # 获取点赞评论等时间
    path('', include(router.urls)),  # 商家信息
    path('search/', views.PostSearchAPIView.as_view()),  # 帖子的搜索
    path('delshop/', views.DelShopAPIView.as_view()),           # 删除商品
    path('orderlist', views.OrderListAPIView.as_view()),        # 订单列表
    path('attentions', views.AttentionsAPIView.as_view()),      # 关注页
    path('fans', views.FansAPIView.as_view()),      # 粉丝页
    path('follow', views.FollowAPIView.as_view()),      # 关注和取消关注
    path('getattention', views.getAttentionAPIView.as_view()),       # 获取关注信息
    path('createcircle', views.CircleCreateAPIView.as_view()),          # 创建圈子
    path('circlelist', views.CircleListAPIView.as_view()),              # 获取圈子信息
    path('circledetail', views.CircleDetailAPIView.as_view()),              # 获取单个圈子信息
    path('circlemember', views.CircleMemberAPIView.as_view()),              # 获取圈子成员信息
    path('applycircle', views.CircleMemberCreateAPIView.as_view()),         # 申请加入圈子
    path('quitcircle', views.CircleMemberDeleteAPIView.as_view()),          # 退出圈子
    path('circlepublishpost', views.circlePublishPostAPIView.as_view()),  # 用户在圈子中发布帖子
    path('circlegetpost', views.CircleGetPostAPIView.as_view()),  # 圈子请求帖子
    path('circlepostdelete', views.CircleDeletePostAPIView.as_view()),       # 圈子删除帖子
    path('mycircle',views.MyCircleListAPIView.as_view()),                        # 获取我创建的圈子
    path('applycirclelist',views.CircleApplyListAPIView.as_view()),             # 获取申请加入圈子的列表
    path('passcircle', views.CircleApplyAPIView.as_view()),                     # 通过申请


]
